package cn.liontalk.PrototypePattern;

public class NoPrototypeTest {
    public static void main(String[] args) {
//        for (int i = 1; i <= 10; i ++) {
//            Book book = new Book("娱乐至死", "尼尔波兹曼", "社会科学", "XXXX");
//            System.out.println("复印书籍：" + book.getName() + "，第 " + i + " 本");
//        }
//    }

        Book2 book1 = new ConcreteBook("娱乐至死", "尼尔波兹曼", "社会科学", "XXXX");
        System.out.println("复印书籍：" + book1.getName() + "，第 " + 1 + " 本");
        for (int i = 2; i <= 10; i++) {
            Book2 book2 = (Book2) book1.clone();
            System.out.println("复印书籍：" + book2.getName() + "，第 " + i + " 本");
        }
    }
}